
<!DOCTYPE html>
<html lang="en" class="loading">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>04_封装案例I - fubaisen</title>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="google" content="notranslate" />
    <meta name="keywords" content="Fechin,"> 
    <meta name="description" content="面向对象封装案例目标
封装
小明爱跑步
存放家具

01. 封装
封装 是面向对象编程的一大特点
面向对象编程的 第一步 —— 将 属性 和 方法 封装 到一个抽象的 类 中
外界 使用 类 创建 ,"> 
    <meta name="author" content="John Doe"> 
    <link rel="alternative" href="atom.xml" title="fubaisen" type="application/atom+xml"> 
    <link rel="icon" href="/img/favicon.png"> 
    
    
    
    <meta name="twitter:card" content="summary"/>
    <meta name="twitter:title" content="04_封装案例I - fubaisen"/>
    <meta name="twitter:description" content="面向对象封装案例目标
封装
小明爱跑步
存放家具

01. 封装
封装 是面向对象编程的一大特点
面向对象编程的 第一步 —— 将 属性 和 方法 封装 到一个抽象的 类 中
外界 使用 类 创建 ,"/>
    
    
    
    
    <meta property="og:site_name" content="fubaisen"/>
    <meta property="og:type" content="object"/>
    <meta property="og:title" content="04_封装案例I - fubaisen"/>
    <meta property="og:description" content="面向对象封装案例目标
封装
小明爱跑步
存放家具

01. 封装
封装 是面向对象编程的一大特点
面向对象编程的 第一步 —— 将 属性 和 方法 封装 到一个抽象的 类 中
外界 使用 类 创建 ,"/>
    
<link rel="stylesheet" href="/css/diaspora.css">

    <script>window.searchDbPath = "/search.xml";</script>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro&display=swap" rel="stylesheet">
<meta name="generator" content="Hexo 6.3.0"></head>

<body class="loading">
    <span id="config-title" style="display:none">fubaisen</span>
    <div id="loader"></div>
    <div id="single">
    <div id="top" style="display: block;">
    <div class="bar" style="width: 0;"></div>
    <a class="iconfont icon-home image-icon" href="javascript:;" data-url="http://fubaisen.github.io"></a>
    <div title="播放/暂停" class="iconfont icon-play"></div>
    <h3 class="subtitle">04_封装案例I</h3>
    <div class="social">
        <div>
            <div class="share">
                <a title="获取二维码" class="iconfont icon-scan" href="javascript:;"></a>
            </div>
            <div id="qr"></div>
        </div>
    </div>
    <div class="scrollbar"></div>
</div>

    <div class="section">
        <div class="article">
    <div class='main'>
        <h1 class="title">04_封装案例I</h1>
        <div class="stuff">
            <span>三月 20, 2022</span>
            
  <ul class="post-tags-list" itemprop="keywords"><li class="post-tags-list-item"><a class="post-tags-list-link" href="/tags/python%E5%AD%A6%E4%B9%A0/" rel="tag">python学习</a></li></ul>


        </div>
        <div class="content markdown">
            <h1 id="面向对象封装案例"><a href="#面向对象封装案例" class="headerlink" title="面向对象封装案例"></a>面向对象封装案例</h1><h2 id="目标"><a href="#目标" class="headerlink" title="目标"></a>目标</h2><ul>
<li>封装</li>
<li>小明爱跑步</li>
<li>存放家具</li>
</ul>
<h3 id="01-封装"><a href="#01-封装" class="headerlink" title="01. 封装"></a>01. 封装</h3><ol>
<li><strong>封装</strong> 是面向对象编程的一大特点</li>
<li>面向对象编程的 <strong>第一步</strong> —— 将 <strong>属性</strong> 和 <strong>方法</strong> <strong>封装</strong> 到一个抽象的 <strong>类</strong> 中</li>
<li><strong>外界</strong> 使用 <strong>类</strong> 创建 <strong>对象</strong>，然后 <strong>让对象调用方法</strong></li>
<li><strong>对象方法的细节</strong> 都被 <strong>封装</strong> 在 <strong>类的内部</strong></li>
</ol>
<h2 id="02-小明爱跑步"><a href="#02-小明爱跑步" class="headerlink" title="02. 小明爱跑步"></a>02. 小明爱跑步</h2><p><strong>需求</strong></p>
<ol>
<li><strong>小明</strong> <strong>体重</strong> <code>75.0</code> 公斤</li>
<li>小明每次 <strong>跑步</strong> 会减肥 <code>0.5</code> 公斤</li>
<li>小明每次 <strong>吃东西</strong> 体重增加 <code>1</code> 公斤</li>
</ol>
<p><img src="https://s2.loli.net/2022/03/20/BsuykA3KWrg6c8H.png" alt="007_小明爱跑步"></p>
<blockquote>
<p>提示：在 <strong>对象的方法内部</strong>，是可以 <strong>直接访问对象的属性</strong> 的！</p>
</blockquote>
<ul>
<li>代码实现：</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">class</span> <span class="title class_">Person</span>:</span><br><span class="line">    <span class="string">&quot;&quot;&quot;人类&quot;&quot;&quot;</span></span><br><span class="line"></span><br><span class="line">    <span class="keyword">def</span> <span class="title function_">__init__</span>(<span class="params">self, name, weight</span>):</span><br><span class="line"></span><br><span class="line">        self.name = name</span><br><span class="line">        self.weight = weight</span><br><span class="line"></span><br><span class="line">    <span class="keyword">def</span> <span class="title function_">__str__</span>(<span class="params">self</span>):</span><br><span class="line"></span><br><span class="line">        <span class="keyword">return</span> <span class="string">&quot;我的名字叫 %s 体重 %.2f 公斤&quot;</span> % (self.name, self.weight)</span><br><span class="line"></span><br><span class="line">    <span class="keyword">def</span> <span class="title function_">run</span>(<span class="params">self</span>):</span><br><span class="line">        <span class="string">&quot;&quot;&quot;跑步&quot;&quot;&quot;</span></span><br><span class="line"></span><br><span class="line">        <span class="built_in">print</span>(<span class="string">&quot;%s 爱跑步，跑步锻炼身体&quot;</span> % self.name)</span><br><span class="line">        self.weight -= <span class="number">0.5</span></span><br><span class="line"></span><br><span class="line">    <span class="keyword">def</span> <span class="title function_">eat</span>(<span class="params">self</span>):</span><br><span class="line">        <span class="string">&quot;&quot;&quot;吃东西&quot;&quot;&quot;</span></span><br><span class="line"></span><br><span class="line">        <span class="built_in">print</span>(<span class="string">&quot;%s 是吃货，吃完这顿再减肥&quot;</span> % self.name)</span><br><span class="line">        self.weight += <span class="number">1</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">xiaoming = Person(<span class="string">&quot;小明&quot;</span>, <span class="number">75</span>)</span><br><span class="line"></span><br><span class="line">xiaoming.run()</span><br><span class="line">xiaoming.eat()</span><br><span class="line">xiaoming.eat()</span><br><span class="line"></span><br><span class="line"><span class="built_in">print</span>(xiaoming)</span><br></pre></td></tr></table></figure>

<p><img src="https://s2.loli.net/2022/03/20/ZA3GvCldV6nQDos.png" alt="image-20220320221837175"></p>
<p>Ps:</p>
<p>​	<img src="https://s2.loli.net/2022/03/20/xS3mBdGNFLbtMTs.png" alt="image-20220320222508907"></p>
<h3 id="2-1-小明爱跑步扩展-——-小美也爱跑步"><a href="#2-1-小明爱跑步扩展-——-小美也爱跑步" class="headerlink" title="2.1 小明爱跑步扩展 —— 小美也爱跑步"></a>2.1 小明爱跑步扩展 —— 小美也爱跑步</h3><p><strong>需求</strong></p>
<ol>
<li><strong>小明</strong> 和 <strong>小美</strong> 都爱跑步</li>
<li><strong>小明</strong> <strong>体重</strong> <code>75.0</code> 公斤</li>
<li><strong>小美</strong> <strong>体重</strong> <code>45.0</code> 公斤</li>
<li>每次 <strong>跑步</strong> 都会减少 <code>0.5</code> 公斤</li>
<li>每次 <strong>吃东西</strong> 都会增加 <code>1</code> 公斤</li>
</ol>
<p><img src="https://s2.loli.net/2022/03/20/BsuykA3KWrg6c8H.png" alt="007_小明爱跑步"></p>
<p><strong>提示</strong></p>
<ol>
<li><p>在 <strong>对象的方法内部</strong>，是可以 <strong>直接访问对象的属性</strong> 的</p>
<p><img src="https://s2.loli.net/2022/03/26/j7cmDGp52IXBE3K.png" alt="image-20220326003736464"></p>
</li>
<li><p><strong>同一个类</strong> 创建的 <strong>多个对象</strong> 之间，<strong>属性</strong> 互不干扰！</p>
</li>
</ol>
<h2 id="03-摆放家具"><a href="#03-摆放家具" class="headerlink" title="03. 摆放家具"></a><img src="https://s2.loli.net/2022/03/20/jDwXOEz4P1uVnfl.png" alt="001_植物大战僵尸">03. 摆放家具</h2><p><strong>需求</strong></p>
<ol>
<li>房子(House)有户型、总面积和家具名称列表<ul>
<li>新房子没有任何的家具</li>
</ul>
</li>
<li>家具(HouseItem)有名字和占地面积，其中<ul>
<li><strong>席梦思(bed)</strong> 占地 <code>4</code> 平米</li>
<li><strong>衣柜(chest)</strong> 占地 <code>2</code> 平米</li>
<li><strong>餐桌(table)</strong> 占地 <code>1.5</code> 平米</li>
</ul>
</li>
<li>将以上三件 <strong>家具</strong> <strong>添加</strong> 到 <strong>房子</strong> 中</li>
<li>打印房子时，要求输出：<strong>户型</strong>、<strong>总面积</strong>、<strong>剩余面积</strong>、<strong>家具名称列表</strong></li>
</ol>
<p><img src="https://s2.loli.net/2022/03/20/owMXR5QqkDWKvY8.png" alt="008_摆放家具"></p>
<p><strong>剩余面积</strong></p>
<ol>
<li>在创建房子对象时，定义一个 <strong>剩余面积的属性</strong>，<strong>初始值和总面积相等</strong></li>
<li>当调用 <code>add_item</code> 方法，向房间 <strong>添加家具</strong> 时，让 <strong>剩余面积</strong> -&#x3D; <strong>家具面积</strong></li>
</ol>
<p><strong>思考</strong>：应该先开发哪一个类？</p>
<p><strong>答案</strong> —— <strong>家具类</strong></p>
<ol>
<li>家具简单</li>
<li>房子要使用到家具，<strong>被使用的类</strong>，通常应该先开发</li>
</ol>
<h3 id="3-1-创建家具"><a href="#3-1-创建家具" class="headerlink" title="3.1 创建家具"></a>3.1 创建家具</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">class</span> <span class="title class_">HouseItem</span>:</span><br><span class="line"></span><br><span class="line">    <span class="keyword">def</span> <span class="title function_">__init__</span>(<span class="params">self, name, area</span>):</span><br><span class="line">        <span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">        :param name: 家具名称</span></span><br><span class="line"><span class="string">        :param area: 占地面积</span></span><br><span class="line"><span class="string">        &quot;&quot;&quot;</span></span><br><span class="line">        self.name = name</span><br><span class="line">        self.area = area</span><br><span class="line"></span><br><span class="line">    <span class="keyword">def</span> <span class="title function_">__str__</span>(<span class="params">self</span>):</span><br><span class="line">        <span class="keyword">return</span> <span class="string">&quot;[%s] 占地面积 %.2f&quot;</span> % (self.name, self.area)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># 1. 创建家具</span></span><br><span class="line">bed = HouseItem(<span class="string">&quot;席梦思&quot;</span>, <span class="number">4</span>)</span><br><span class="line">chest = HouseItem(<span class="string">&quot;衣柜&quot;</span>, <span class="number">2</span>)</span><br><span class="line">table = HouseItem(<span class="string">&quot;餐桌&quot;</span>, <span class="number">1.5</span>)</span><br><span class="line"></span><br><span class="line"><span class="built_in">print</span>(bed)</span><br><span class="line"><span class="built_in">print</span>(chest)</span><br><span class="line"><span class="built_in">print</span>(table)</span><br></pre></td></tr></table></figure>

<p><strong>小结</strong></p>
<ol>
<li>创建了一个 <strong>家具类</strong>，使用到 <code>__init__</code> 和 <code>__str__</code> 两个内置方法</li>
<li>使用 <strong>家具类</strong> 创建了 <strong>三个家具对象</strong>，并且 <strong>输出家具信息</strong></li>
</ol>
<h3 id="3-2-创建房间"><a href="#3-2-创建房间" class="headerlink" title="3.2 创建房间"></a>3.2 创建房间</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">class</span> <span class="title class_">House</span>:</span><br><span class="line"></span><br><span class="line">    <span class="keyword">def</span> <span class="title function_">__init__</span>(<span class="params">self, house_type, area</span>):</span><br><span class="line">        <span class="string">&quot;&quot;&quot;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">        :param house_type: 户型</span></span><br><span class="line"><span class="string">        :param area: 总面积</span></span><br><span class="line"><span class="string">        &quot;&quot;&quot;</span></span><br><span class="line">        self.house_type = house_type</span><br><span class="line">        self.area = area</span><br><span class="line">        </span><br><span class="line">        <span class="comment"># 剩余面积默认和总面积一致</span></span><br><span class="line">        self.free_area = area</span><br><span class="line">        <span class="comment"># 默认没有任何的家具</span></span><br><span class="line">        self.item_list = []</span><br><span class="line"></span><br><span class="line">    <span class="keyword">def</span> <span class="title function_">__str__</span>(<span class="params">self</span>):</span><br><span class="line"></span><br><span class="line">        <span class="comment"># Python 能够自动的将一对括号内部的代码连接在一起</span></span><br><span class="line">        <span class="keyword">return</span> (<span class="string">&quot;户型：%s\n总面积：%.2f[剩余：%.2f]\n家具：%s&quot;</span></span><br><span class="line">                % (self.house_type, self.area,</span><br><span class="line">                   self.free_area, self.item_list))</span><br><span class="line"></span><br><span class="line">    <span class="keyword">def</span> <span class="title function_">add_item</span>(<span class="params">self, item</span>):</span><br><span class="line"></span><br><span class="line">        <span class="built_in">print</span>(<span class="string">&quot;要添加 %s&quot;</span> % item)</span><br><span class="line"></span><br><span class="line">...</span><br><span class="line"></span><br><span class="line"><span class="comment"># 2. 创建房子对象</span></span><br><span class="line">my_home = House(<span class="string">&quot;两室一厅&quot;</span>, <span class="number">60</span>)</span><br><span class="line"></span><br><span class="line">my_home.add_item(bed)</span><br><span class="line">my_home.add_item(chest)</span><br><span class="line">my_home.add_item(table)</span><br><span class="line"></span><br><span class="line"><span class="built_in">print</span>(my_home)</span><br></pre></td></tr></table></figure>

<p><strong>小结</strong></p>
<ol>
<li>创建了一个 <strong>房子类</strong>，使用到 <code>__init__</code> 和 <code>__str__</code> 两个内置方法</li>
<li>准备了一个 <code>add_item</code> 方法 <strong>准备添加家具</strong></li>
<li>使用 <strong>房子类</strong> 创建了 <strong>一个房子对象</strong></li>
<li>让 <strong>房子对象</strong> 调用了三次 <code>add_item</code> 方法，将 <strong>三件家具</strong> 以实参传递到 <code>add_item</code> 内部</li>
</ol>
<h3 id="3-3-添加家具"><a href="#3-3-添加家具" class="headerlink" title="3.3 添加家具"></a>3.3 添加家具</h3><p><strong>需求</strong></p>
<ul>
<li>1&gt; <strong>判断</strong> <strong>家具的面积</strong> 是否 <strong>超过剩余面积</strong>，<strong>如果超过</strong>，提示不能添加这件家具</li>
<li>2&gt; 将 <strong>家具的名称</strong> 追加到 <strong>家具名称列表</strong> 中</li>
<li>3&gt; 用 <strong>房子的剩余面积</strong> - <strong>家具面积</strong></li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">def</span> <span class="title function_">add_item</span>(<span class="params">self, item</span>):</span><br><span class="line"></span><br><span class="line">    <span class="built_in">print</span>(<span class="string">&quot;要添加 %s&quot;</span> % item)</span><br><span class="line">    <span class="comment"># 1. 判断家具面积是否大于剩余面积</span></span><br><span class="line">    <span class="keyword">if</span> item.area &gt; self.free_area:</span><br><span class="line">        <span class="built_in">print</span>(<span class="string">&quot;%s 的面积太大，不能添加到房子中&quot;</span> % item.name)</span><br><span class="line"></span><br><span class="line">        <span class="keyword">return</span></span><br><span class="line"></span><br><span class="line">    <span class="comment"># 2. 将家具的名称追加到名称列表中</span></span><br><span class="line">    self.item_list.append(item.name)</span><br><span class="line"></span><br><span class="line">    <span class="comment"># 3. 计算剩余面积</span></span><br><span class="line">    self.free_area -= item.area</span><br></pre></td></tr></table></figure>

<h3 id="3-4-小结"><a href="#3-4-小结" class="headerlink" title="3.4 小结"></a>3.4 小结</h3><ul>
<li>主程序只负责创建 <strong>房子</strong> 对象和 <strong>家具</strong> 对象</li>
<li>让 <strong>房子</strong> 对象调用 <code>add_item</code> 方法 <strong>将家具添加到房子</strong>中</li>
<li><strong>面积计算</strong>、<strong>剩余面积</strong>、<strong>家具列表</strong> 等处理都被 <strong>封装</strong> 到 <strong>房子类的内部</strong></li>
</ul>

            <!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->
            <audio id="audio" loop="1" preload="auto" controls="controls" data-autoplay="false">
                <source type="audio/mpeg" src="">
            </audio>
            
                <ul id="audio-list" style="display:none">
                    
                        
                            <li title="0" data-url="http://link.hhtjim.com/163/425570952.mp3"></li>
                        
                    
                        
                            <li title="1" data-url="http://link.hhtjim.com/163/425570952.mp3"></li>
                        
                    
                </ul>
            
        </div>
        
        
    <div id="gitalk-container" class="comment link"
		data-enable="false"
        data-ae="false"
        data-ci=""
        data-cs=""
        data-r=""
        data-o=""
        data-a=""
        data-d="false"
    >查看评论</div>


    </div>
    
</div>


    </div>
</div>
</body>


<script src="//lib.baomitu.com/jquery/1.8.3/jquery.min.js"></script>
<script src="/js/plugin.js"></script>
<script src="/js/typed.js"></script>
<script src="/js/diaspora.js"></script>


<link rel="stylesheet" href="/photoswipe/photoswipe.css">
<link rel="stylesheet" href="/photoswipe/default-skin/default-skin.css">


<script src="/photoswipe/photoswipe.min.js"></script>
<script src="/photoswipe/photoswipe-ui-default.min.js"></script>


<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>
    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">
        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>
        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">
            <div class="pswp__top-bar">
                <!--  Controls are self-explanatory. Order can be changed. -->
                <div class="pswp__counter"></div>
                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
                <button class="pswp__button pswp__button--share" title="Share"></button>
                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                      <div class="pswp__preloader__cut">
                        <div class="pswp__preloader__donut"></div>
                      </div>
                    </div>
                </div>
            </div>
            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div> 
            </div>
            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>
            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>
            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>
        </div>
    </div>
</div>






</html>
